<Query Kind="Statements">
  <Connection>
    <ID>a227fb82-8e77-4297-a037-c08cd4b366e6</ID>
    <Persist>true</Persist>
    <Server>.\SQLEXPRESS</Server>
    <Database>RNC681_2008</Database>
    <ShowServer>true</ShowServer>
  </Connection>
</Query>

TimeSpan timer=IuPS_ATTs.Max(e=>e.PacketTime).Value- IuPS_ATTs.Min(e=>e.PacketTime).Value;
var mTime=timer.TotalSeconds;
var tt=IuPS_ATTs.Min(e=>e.PacketTime).Value.ToString()+"~"+IuPS_ATTs.Max(e=>e.PacketTime).Value.ToString()+"~"+mTime.ToString();
tt.Dump();
var a= from p in IuPS_ATTs.Where (e=>e.DumpFor =="EndFlowByFlowDesigner")
//	group p by new { p.DumpFor ,p.Attach_Reject }       into ps
//	let c=p.DumpFor  ==null ? "--":"EndFlow"
	group p by p._2G_LAC      into ps
//	orderby ps.Key 
	select new {
	mKey=ps.Key ,
//	mStartEnd=ps.Min(e=>e.PacketTime.Value  )+"~"+ps.Max  (e=>e.PacketTime.Value),
//	mTimer=ps.Max  (e=>e.PacketTime.Value)-ps.Min(e=>e.PacketTime.Value  ),
	mName="Attach",
	mRequest=ps.Sum (e=>e.Attach_Request),
	mSuccess= ps.Sum (e=>e.Attach_Complete),
	mSuccRate= (ps.Sum (e=>e.Attach_Complete)+0.0)/ps.Sum (e=>e.Attach_Request),
	mDelay= ps.Where (e=>e.Attach_Complete !=null).Average(e =>e.Attach_Complete_delayFirst)
	};
	a.Dump ();
//	a.OrderBy (e=>e.mSuccRate ).ThenBy (e=>e.mKey ).Dump ();